package com.oocl.util;

import java.util.regex.Pattern;

public class ValidateUtil {
	public static boolean isNullOrEmpty(String s) {
		return s == null || s.isEmpty();
	}
	
	public static boolean isInteger(String s) {
		String regex = "^\\d+$";
		return Pattern.compile(regex).matcher(s).find();
	}
	
	public static boolean isDouble(String s) {
		String regex = "^(\\d+\\.?\\d*)|(\\d*\\.?\\d+)$";
		return Pattern.compile(regex).matcher(s).find();
	}
	
	public static boolean isDate(String s) {
		String regex = "^\\d{4}-\\d{1,2}-\\d{1,2}$";
		return Pattern.compile(regex).matcher(s).find();
	}
}
